﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MMDemo
{
    public partial class QueueYangHForm : Form
    {
        public QueueYangHForm()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("请输入数据！");
            }

            else
            {
                try
                {

                    int temp = Convert.ToInt32(textBox1.Text.Trim()); 
                    if (temp <= 9 && temp >= 1)
                    {
                        GlobalQueue.YangHuiOrderData = temp;
                        PublicDataClass.IsInit = true;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("输入错误，请重新输入！");
                        textBox1.Clear();
                    }
                    
                }
                catch
                {
                    MessageBox.Show("输入错误，请重新输入！");
                    textBox1.Clear();
                }
            }
        }

        private void NewQueueForm_Load(object sender, EventArgs e)
        {
            //this.ControlBox = false;
        }

        protected override void WndProc(ref   Message m)
        {
            const int WM_SYSCOMMAND = 0x0112;
            const int SC_CLOSE = 0xF060;
            if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
            {
                PublicDataClass.IsInit = false;
                this.Close();
                return;
            }
            base.WndProc(ref m);
        }
    }
}
